package edu.pku.sei.transformation.tgg.adapter;

import java.util.ArrayList;
import java.util.List;

import edu.pku.sei.transformation.editor.model.MetaModel;
import edu.pku.sei.transformation.editor.model.ModelType;
import edu.pku.sei.transformation.editor.model.TypedModel;
import edu.pku.sei.transformation.tgg.rule.IDomain;
import edu.pku.sei.transformation.tgg.rule.IModelParameter;

public class ModelParameterAdapter implements IModelParameter {
	TypedModel element;
	List<IDomain> domains = new ArrayList<IDomain>();
	public ModelParameterAdapter(TypedModel typedModel) {
		this.element = typedModel;
	}

	@Override
	public String getName() {
		return element.getName();
	}

	@Override
	public String getID() {
		return String.valueOf(element.getElementID());
	}

	@Override
	public List<IDomain> getDomains() {
		return domains;
	}
	
	@Override
	public String getPath() {
		ModelType modelType = (ModelType) element.getType();
		MetaModel metaModel = (MetaModel) modelType.getType();
		return metaModel.getFilePath()+"#/";
	}
	
	@Override
	public void addDomain(IDomain domain) {
		this.domains.add(domain);
	}

}
